{php include pubTemplate("header_admin")}

<script src="public/js/jquery.min.js" type="text/javascript"></script>
<script>
//设为导航
function isappnav(appkey,appname){
	$.ajax({
		type:"POST",
		url:"index.php?app=system&ac=apps&ts=appnav",
		data:"&appkey="+appkey+"&appname="+appname,
		beforeSend:function(){},
		success:function(result){
			if(result == '1'){
				window.location.reload(true); 
			}
		}
	})
}

//取消导航
function unisappnav(appkey){
	$.ajax({
		type:"POST",
		url:"index.php?app=system&ac=apps&ts=unappnav",
		data:"&appkey="+appkey,
		beforeSend:function(){},
		success:function(result){
			if(result == '1'){
				window.location.reload(true); 
			}
		}
	})
}

function ismynav(appkey,appname){
    $.post('index.php?app=system&ac=apps&ts=mynav',{'appkey':appkey,'appname':appname},function(rs){
        if(rs==1){
            window.location.reload(true);
        }
    })
}

function unismynav(appkey){
    $.post('index.php?app=system&ac=apps&ts=unmynav',{'appkey':appkey},function(rs){
        if(rs==1){
            window.location.reload(true);
        }
    })
}

</script>


<div class="midder">

    {template apps_menu}

<table class="table table-hover">
    <thead class="thead-light">
    <tr>
        <th>应用名称</th>
        <th>版本</th>
        <th>介绍</th>
        <th>作者</th>
        <th>管理</th>
        <th>顶部导航</th>
        <th>我的社区导航</th>
    </tr>
    </thead>

    <tbody>
{loop $arrApp $keys $item}
<tr>
<td>
    <img width="24" height="24" src="{$item['icon']}">
    {$item['about']['name']}({$item['name']})
</td>
<td class="fs12 c9">{$item['about']['version']}
</td>
<td class="fs12 c9">{$item['about']['desc']}</td>
<td class="fs12 c9">{$item['about']['author']}</td>
<td>
{if $item['about']['isoption'] == '1' && $item['about']['isinstall']=='1'}
    <a class="btn btn-sm btn-outline-info fs12" href="index.php?app={$item['name']}&ac=admin&mg=options"><i class="bi bi-list-check"></i>管理</a>
    {/if}
</td>


<td>


{if $item['about']['isappnav'] == '1' && $TS_SITE['appnav'][$item['name']] == ''}
    <a class="btn btn-outline-primary btn-sm fs12" href="javascript:void('0');" onclick="isappnav('{$item['name']}','{$item['about']['name']}');"><i class="bi bi-play-circle"></i>开启</a>
    {/if}

{if $item['about']['isappnav'] == '1' && $TS_SITE['appnav'][$item['name']] != ''}
    <a class="btn btn-outline-secondary btn-sm fs12" href="javascript:void('0');" onclick="unisappnav('{$item['name']}');"><i class="bi bi-stop-circle"></i>取消</a>
    {/if}



</td>


    <td>

        {if $item[about]['ismy'] == '1' && $TS_SITE['mynav'][$item['name']] == ''}
        <a class="btn btn-outline-primary btn-sm fs12" href="javascript:void('0');" onclick="ismynav('{$item['name']}','{$item['about']['name']}');"><i class="bi bi-play-circle"></i>开启</a>
        {/if}

        {if $item['about']['ismy'] == '1' && $TS_SITE['mynav'][$item['name']] != ''}
        <a class="btn btn-outline-secondary btn-sm fs12" href="javascript:void('0');" onclick="unismynav('{$item['name']}');"><i class="bi bi-stop-circle"></i>取消</a>
        {/if}

    </td>


</tr>
{/loop}
    </tbody>


</table>

</div>

{php include pubTemplate("footer_admin")}